/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ManagersUI;

import ControladoresUI.AulasController;
import ControladoresUI.ReportesController;
import java.io.IOException;
import java.util.logging.*;
import javafx.fxml.FXMLLoader;
import javafx.scene.*;
import Entidades.Usuario;
import javafx.scene.layout.HBox;
import javafx.stage.Stage;

/**
 *
 * @author JEscalante
 */
public class ReportesManager {
    private Scene scene;
    private Stage stage;
    public Parent root;
    public HBox pnlPrincipal;
    public ReportesManager(Scene scene, Stage stage) {
        this.scene = scene;
        this.stage = stage;
    }

    public void abrirPanelReportes(){
        try {
            FXMLLoader loader = new FXMLLoader(getClass().getResource("/VistasUI/pnlReportes.fxml"));
            root = (Parent) loader.load();
            ReportesController controller = loader.<ReportesController>getController();
            controller.initManager(this);
        } catch (IOException ex) {
            Logger.getLogger(ReportesManager.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    public void showPnlReportesGeneral(){
        Parent root = null;
        ReportesGeneralManager reportesGeneralManager = new ReportesGeneralManager(scene,stage,this);
        reportesGeneralManager.abrirPanelReportesGeneral();
        root = reportesGeneralManager.root;
        
        if(pnlPrincipal.getChildren().size()>1)
            pnlPrincipal.getChildren().remove(1);
        //this.ventanaManager.showPnlUsuarios(Usuario);
        pnlPrincipal.getChildren().add(root);
    }
    public void showPnlReportesCatedratico(){
        Parent root = null;
        ReportesCatedraticoManager reportesCatedraticoManager = new ReportesCatedraticoManager(scene,stage,this);
        reportesCatedraticoManager.abrirPanelReportesCatedratico();
        root = reportesCatedraticoManager.root;
        
        if(pnlPrincipal.getChildren().size()>1)
            pnlPrincipal.getChildren().remove(1);
        //this.ventanaManager.showPnlUsuarios(Usuario);
        pnlPrincipal.getChildren().add(root);
    }
}
